package com.qf.cloud2204.feign.feignclient;

import com.qf.cloud2204.common.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

@FeignClient("MICROA")//声明该feignClient要调用的微服务的名字
public interface MircoAClient {
    //写要调用接口的方法签名部分public String hello();
    //需要把接口整体路径补全
    @RequestMapping(value = "/a/hello",method = RequestMethod.GET)
    public String hello();

    @GetMapping("/user/findAll")
    List<User> findAll();

    @PostMapping("/user/update")
    User updateUser(@RequestBody User user);

    @DeleteMapping("/user/delete/{id}")
    User deleteUser(@PathVariable("id") Integer id);

    //查询字符串传参需要加@RequestParam feign扫描注解最好都带上
    @RequestMapping(value = "/user/find",method = RequestMethod.GET)
    User findUserByName(@RequestParam("username") String username);
}
